package com.hoe.tsb.fraft;

import com.hoe.tsb.Configuration;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * <p>
 * FRaft的Node节点
 * </p>
 *
 * @author hoe
 * @version 1.0
 * @date 2022/11/21 16:52
 */
@Slf4j
public class Node {
    @Setter
    @Getter
    private String ip;

    @Setter
    @Getter
    private int port;

    @Setter
    @Getter
    private String publicKey;

    @Setter
    @Getter
    private boolean isLeader;

    public Node() {
    }

    public Node(String ip, int port) {
        this(ip, port , null);
    }

    public Node(String ip, int port, String publicKey) {
        this.ip = ip;
        this.port = port;
        this.publicKey = publicKey;
    }
}
